var gdId,devId,source;
$(function () {
    //获取工单ID
    gdId= getQueryString("id");
    devId= getQueryString("devId");
    source= getQueryString("source");
    //获取责任人接口
    var url = '../sys/user/loadWorkshopRoleUserList?roleCode=RL13';
    Ajax.request({
        url: url,
        async: true,
        successCallback: function (data) {
           vm.personnelList = data.userList;
        }
    });
})
var vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        title: null,
        // isrepairTypeList: enumsToList("ISREPAIR_TYPE"),//是否加入维护库
        // errorReseList: enumsToList("ERROR_RESE"),//异常来源
        excepRecord: {
            originRecordId: gdId,//来源id
            dutyUserId:'',//责任人id
            startDate:'',//待办事项开始时间
            endDate:'',//结束日期必填
            source:source,//异常来源
            questionDesc:'',//问题描述
            measure:'',//建议
        },
        ruleValidate: {
            name: [
                {required: true, message: '名称不能为空', trigger: 'blur'}
            ]
        },
        q: {
            name: ''
        },
        personnelList:[]//人员列表
    },
    methods: {
        query: function () {
            vm.reload();
        },
        reload: function (event) {
            vm.showList = true;
            var page = $("#jqGrid").jqGrid('getGridParam', 'page');
            $("#jqGrid").jqGrid('setGridParam', {
                postData: {'name': vm.q.name},
                page: page
            }).trigger("reloadGrid");
            vm.handleReset('formValidate');
        },
        reloadSearch: function () {
            vm.q = {
                name: ''
            };
            vm.reload();
        },
        handleSubmit: function (name) {
            handleSubmitValidate(this, name, function () {
                vm.saveOrUpdate();
            });
        },
        handleReset: function (name) {
            handleResetForm(this, name);
        }
    }
});
var getExcept = function () {
    vm.excepRecord.originRecordId=gdId;
    vm.excepRecord.source = source;
    return vm.excepRecord;
}
